package com.xiangyu.demo.configuration;

import com.xiangyu.demo.interceptor.MyInterceptor;
import com.xiangyu.demo.interceptor.MyInterceptor2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * java类简单作用描述
 *
 * @ProjectName: springboot-demo
 * @Package: com.xiangyu.demo.configuration
 * @Description: 注册拦截器
 * @Author: 向羽
 * @CreateDate: 2018/1/19 14:43
 * @UpdateUser: 向羽
 * @UpdateDate: 2018/1/19 14:43
 * @UpdateRemark: The modified content
 * @Version: 2.0
 */
@Configuration
public class MyWebConfig extends WebMvcConfigurerAdapter {
    @Autowired
    private MyInterceptor myInterceptor;
    @Autowired
    private MyInterceptor2 myInterceptor2;

    /**
      * @Author: 向羽
      * @Description: 注册拦截器
      * @Date: 2018/1/19 14:45
      */
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(myInterceptor);
        registry.addInterceptor(myInterceptor2);
    }


}
